package com.right.health.app.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/*
 * Created by hopeliao on 2019-11-06
 *
 */
public class AppUserResponse implements Parcelable {

    public AppUserInfo user;

    public static class AppUserInfo implements Parcelable {

        /**
         * isManbing: 是否慢病备案(1：已备案，0：未备案),
         *  balance: 社保卡余额
         */
        public String mobilephone;
        public String sex;
        public String memberid;
        public String loginpwd;
        public String personid;
        public String age;
        public String verifystatus;
        public String imageurl;
        public String personname;
        public String idcard;
        public String healthcardno;
        public String patientidcardnum;
        public int isManbing;
        public double balance;
        public List<ManBingInfo> manbingList;

        public AppUserInfo() {
        }


        public boolean isVertificationSucc() {
            return "1".equals(verifystatus);
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.mobilephone);
            dest.writeString(this.sex);
            dest.writeString(this.memberid);
            dest.writeString(this.loginpwd);
            dest.writeString(this.personid);
            dest.writeString(this.age);
            dest.writeString(this.verifystatus);
            dest.writeString(this.imageurl);
            dest.writeString(this.personname);
            dest.writeString(this.idcard);
            dest.writeString(this.healthcardno);
            dest.writeString(this.patientidcardnum);
        }

        protected AppUserInfo(Parcel in) {
            this.mobilephone = in.readString();
            this.sex = in.readString();
            this.memberid = in.readString();
            this.loginpwd = in.readString();
            this.personid = in.readString();
            this.age = in.readString();
            this.verifystatus = in.readString();
            this.imageurl = in.readString();
            this.personname = in.readString();
            this.idcard = in.readString();
            this.healthcardno = in.readString();
            this.patientidcardnum = in.readString();
        }

        public static final Creator<AppUserInfo> CREATOR = new Creator<AppUserInfo>() {
            @Override
            public AppUserInfo createFromParcel(Parcel source) {
                return new AppUserInfo(source);
            }

            @Override
            public AppUserInfo[] newArray(int size) {
                return new AppUserInfo[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(this.user, flags);
    }

    public AppUserResponse() {
    }

    protected AppUserResponse(Parcel in) {
        this.user = in.readParcelable(AppUserInfo.class.getClassLoader());
    }

    public static final Parcelable.Creator<AppUserResponse> CREATOR = new Parcelable.Creator<AppUserResponse>() {
        @Override
        public AppUserResponse createFromParcel(Parcel source) {
            return new AppUserResponse(source);
        }

        @Override
        public AppUserResponse[] newArray(int size) {
            return new AppUserResponse[size];
        }
    };
}
